import { defineStore } from "pinia";

export const useMainStore = defineStore("main", {
    state: () => {
        return {
            // 所有这些属性都将自动推断其数据类型
            counter: 2,
        };
    },
    getters: {
        doubleCount(state) {
            return this.counter * 2;
        },
    },
    actions: {
        increment() {
            this.counter++;
        },
    },
});
